import { FC, useContext, useState } from "react";
import { ThemesContext, themes } from "./index";

const ThemeButton: FC = () => {
    const { theme, setTheme } = useContext(ThemesContext);
    const style = {
        color: theme.color,
        background: theme.background
    }
    const toggleTheme = () => setTheme(theme === themes.light ? themes.dark : themes.light);
    return (
        <>
            <div>Themes Button</div>
            <button style={style} onClick={toggleTheme}>theme button</button>
        </>
    )
}
export default ThemeButton;